{include file="public_head" /}
<!-- upload -->
<link href="__STATIC__/css/uploads.css" rel="stylesheet">
<!-- upload_arr -->
<link href="__STATIC__/plupload/plupload.css" rel="stylesheet">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<!-- sku -->
<link href="__STATIC__/css/sku.css" rel="stylesheet" type="text/css">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<link rel="stylesheet" href="/pic/js/amazeui.min.css" />
<style>
    .middle-img {
        position: absolute;
        left: 259px;
        top: 0px;
        width: 40px;
    }

    .up-img {
        position: absolute;
        top: -40px;
        left: 261px;
        width: 40px;
    }

    .down-img {
        position: absolute;
        top: 40px;
        left: 257px;
        width: 40px;
    }

    .left-img {
        position: absolute;
        left: 218px;
        width: 40px;
    }

    .right-img {
        position: absolute;
        left: 300px;
        width: 40px;
    }
    @media screen and (max-width:450px) {
        .middle-img {
            position: absolute;
            left: 259px;
            top: 0px;
            width: 40px;
            display: none;
        }

        .up-img {
            position: absolute;
            top: -40px;
            left: 261px;
            width: 40px;
            display: none;
        }

        .down-img {
            position: absolute;
            top: 40px;
            left: 257px;
            width: 40px;
            display: none;
        }

        .left-img {
            position: absolute;
            left: 218px;
            width: 40px;
            display: none;
        }

        .right-img {
            position: absolute;
            left: 300px;
            width: 40px;
            display: none;
        }

        .rotate_jia{
            display: none;
        }.rotate_div{
             display: none;
         }.rotate_jian{
              display: none;
          }
    }
</style>

<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>服务订单管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>创建订单
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>

                            <div class="x_content" id="ele2"><div id="printArea">
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                      method="post" id="registerForm">
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">所属分类：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            <div>{$item.parent_title}->{$item.single_title}</div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">订 单 号：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            <div>{$item.order_number}</div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">服务门店：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" style="margin-top: 8px;">
                                            {$item.shop_title}
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">用户名：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" style="margin-top: 8px;">
                                            {$item.username}
                                        </div>
                                        {eq name="222" value="11"}<span style="position: relative;bottom:-8px;">寄存金额为0 就是免费寄存</span>{else/}{/eq}

                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车牌号：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            {if condition="$item.is_certification neq 2"}
                                            <input type="text" style="float: left; height: 34px; margin-right: 10px;" name="car_number" value="{$item.car_number}" {notempty name="$item.car_number"}readonly{/notempty} />{empty name="$item.car_number"}<a  class="btn btn-primary" onClick="car_number(this)">修改</a>{/empty}
                                            {else/}
                                            <div>{$item.car_number}</div>
                                            {/if}

                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车型：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <input type="text" style="float: left; height: 34px; margin-right: 10px;" name="chexing" value="{$item.chexing|default=''}" />
                                        </div>
                                    </div>
                                    
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">是否认证：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{:input('is_certification_text')}</div>
                                        </div>
                                    </div>
                                    <script>
                                        function car_number(t) {
                                            var member_id = "{$item.member_id}";
                                            var v = $(t).prev().val();
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('member/car_number')}",
                                                data: {id:member_id,car_number:v},
                                                dataType: "json",
                                                success: function(ret){
                                                    //ret == true == 1/*?*/
                                                    if(ret == true){
                                                        layer.msg(ret.message);
                                                        history.go(0);
                                                    }
                                                    else{
                                                        layer.msg(ret.message);
                                                        history.go(0);
                                                    }
                                                }

                                            });
                                        }
                                    </script>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">费用类型：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" style="margin-top: 8px;">
                                            {eq name=":input('order_is_free')" value="2"}付费{else/}免费{/eq}
                                        </div>
                                        {eq name="222" value="11"}<span style="position: relative;bottom:-8px;">寄存金额为0 就是免费寄存</span>{else/}{/eq}

                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">{eq name="222" value="11"}寄存金额{else/}服务金额{/eq}：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" >
                                            <input  type="text" placeholder="请填写订单总额" {neq name="$single_parent_id" value="1"}{neq name=":input('order_is_free')" value="3"}readonly{/neq}{/neq}
                                            class="form-control col-md-7 col-xs-12" name="order_price"
                                            value="{neq name="$single_parent_id" value="1"}{$amount|default='0'}{else/}0{/neq}" datatype="*" nullmsg="请填写订单总额"
                                            >
                                        </div>
                                        <span style="position: relative;bottom:-8px;">服务金额</span>
                                        {eq name="222" value="11"}<span style="position: relative;bottom:-8px;">寄存金额为0 就是免费寄存</span>{else/}{/eq}

                                    </div>
                                    {eq name="$single_parent_id" value="1"}
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">车船使用税：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" >
                                            <input type="text" placeholder="填写运费就是上门配送" onChange=""
                                                   class="form-control col-md-7 col-xs-12" name="sj"
                                                   value="{$item.sj|default='0'}" datatype="*" nullmsg="请填写运费金额"
                                            >
                                        </div>
                                        <!--<span style="position: relative;bottom:-8px;">填写大于0的运费金额 就是上门服务</span>-->
                                    </div>
                                    {/eq}
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">运费金额：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" >
                                            <input type="text" placeholder="填写运费就是上门配送" onChange=""
                                                   class="form-control col-md-7 col-xs-12" name="freight"
                                                   value="{$item.freight|default='0'}" datatype="*" nullmsg="请填写运费金额"
                                            >
                                        </div>
                                        <!--<span style="position: relative;bottom:-8px;">填写大于0的运费金额 就是上门服务</span>-->
                                    </div>


                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" style="text-align: right">服务方式：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="shipping" id="status_1" class="cartradio"
                                                       value="1"
                                                       datatype="*"
                                                       nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                       {eq name='item.type|default="1"' value='1' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_1"></label>
                                                <span>商家配送</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="shipping" id="status_2" class="cartradio"
                                                       value="2"
                                                       datatype="*"
                                                       nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                       {eq name='item.type|default=""' value='2' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_2"></label>
                                                <span>到店自取</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>



                                    <div id="shipping">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">联系人：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写联系人"
                                                       class="form-control col-md-7 col-xs-12" name="shipping_name"
                                                       value="{$item.shipping_name|default=''}"
                                                >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">联系人手机号：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写联系人手机号"
                                                       class="form-control col-md-7 col-xs-12" name="shipping_phone"
                                                       value="{$item.shipping_phone|default=''}"
                                                >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">配送区域：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写配送区域"
                                                       class="form-control col-md-7 col-xs-12" name="shipping_province"
                                                       value="{$item.shipping_province|default=''}"
                                                >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">配送详细地址：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写配送详细地址"
                                                       class="form-control col-md-7 col-xs-12" name="shipping_address"
                                                       value="{$item.shipping_address|default=''}"
                                                >
                                            </div>
                                        </div>
                                    </div>

                                    {in name="$item.parent_id" value="1,2"}
                                    {eq name="$item.parent_id" value="1"}
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" style="text-align: right">投保险种：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            {foreach name="$protect_type" item="vo" key="k"}
                                            <label class="radio_box">
                                                <input type="checkbox" name="type_id_str[]" id="status_100{$key}" class="cartradio"
                                                       value="{$vo.id}"
                                                       datatype="*"
                                                       nullmsg="请选择投保险种！" errormsg="请选择投保险种！"
                                                       {eq name='$k' value='0' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_100{$key}"></label>
                                                <span>{$vo.title}</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            {/foreach}
                                        </div>
                                    </div>
                                    {/eq}
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">{eq name="$item.parent_id" value="2"}送检人员{/eq}
                                            {eq name="$item.parent_id" value="1"}被保险人{/eq}：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                            <div>
                                                <input type="text" placeholder="请输入{eq name="$item.parent_id" value="2"}送检人员{/eq}
                                                {eq name="$item.parent_id" value="1"}被保险人{/eq}"
                                                       class="form-control col-md-7 col-xs-12" name="protecteder"
                                                       value="{$item.service_info.protecteder|default=''}"
                                                       datatype="*"
                                                       nullmsg="请输入{eq name="$item.parent_id" value="2"}送检人员{/eq}
                                                {eq name="$item.parent_id" value="1"}被保险人{/eq}！" errormsg="请输入{eq name="$item.parent_id" value="2"}送检人员{/eq}
                                                {eq name="$item.parent_id" value="1"}被保险人{/eq}！"
                                                >
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">手机号码：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                            <div>
                                                <input type="text" placeholder="请输入手机号码"
                                                       class="form-control col-md-7 col-xs-12" name="phone"
                                                       value="{$item.service_info.phone|default=''}"
                                                       datatype="s11-11"
                                                       nullmsg="请输入手机号码！" errormsg="请输入正确手机号码！"
                                                >
                                            </div>
                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">车主姓名：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                            <div>
                                                <input type="text" placeholder="请输入车主姓名"
                                                       class="form-control col-md-7 col-xs-12" name="plat_name"
                                                       value="{$item.service_info.plat_name|default=''}"
                                                       datatype="*"
                                                       nullmsg="请输入车主姓名！" errormsg="请输入车主姓名！"
                                                >
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">车牌号码：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                        <div>
                                            <input type="text" placeholder="请输入车牌号码"
                                                   class="form-control col-md-7 col-xs-12" name="plat_number"
                                                   value="{$item.service_info.plat_number|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入车牌号码！" errormsg="请输入车牌号码！"
                                            >
                                        </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">车辆识别码：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                        <div>
                                            <input type="text" placeholder="请输入车辆识别码"
                                                   class="form-control col-md-7 col-xs-12" name="plat_code"
                                                   value="{$item.service_info.plat_code|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入车辆识别码！" errormsg="请输入车辆识别码！"
                                            >
                                        </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">发动机号：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                        <div>
                                            <input type="text" placeholder="请输入发动机号"
                                                   class="form-control col-md-7 col-xs-12" name="engine_number"
                                                   value="{$item.service_info.engine_number|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入发动机号！" errormsg="请输入发动机号！"
                                            >
                                        </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">品牌型号：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                        <div>
                                            <input type="text" placeholder="请输入品牌型号"
                                                   class="form-control col-md-7 col-xs-12" name="brand_number"
                                                   value="{$item.service_info.brand_number|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入品牌型号！" errormsg="请输入品牌型号！"
                                            >
                                        </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">注册日期：</label>
                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                        <div>
                                            <input type="text" placeholder="请输入注册日期" onClick="WdatePicker()"
                                                   class="form-control col-md-7 col-xs-12" name="register_time"
                                                   value="{$item.service_info.register_time|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入注册日期！" errormsg="请输入注册日期！"
                                            >
                                        </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">投保人身份证:</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <div style="float: left">
                                                <div id="imgdiv">
                                                    <img id="imgShow" src="__PUBLIC__/{$item.single_pic|default=''}"
                                                         width="200" height="190" onerror="this.src='__STATIC__/images/default.png'"
                                                    />
                                                </div>
                                                <div class="uploader white">
                                                    <input type="text" class="filename" name="protecter_face"
                                                           value="{$item.picUrl|default=''}" readonly/>
                                                    <input type="button" name="protecter_face" class="button" value="正面..."/>
                                                    <input type="file" id="up_img" name="protecter_face" datatype="*"
                                                           value='{$item.picUrl|default=""}'  />
                                                </div>
                                            </div>
                                            <div style="float: left">
                                                <div id="imgdiv1">
                                                    <img id="imgShow1" src="__PUBLIC__/{$item.single_pic|default=''}"
                                                         width="200" height="190" onerror="this.src='__STATIC__/images/default.png'"
                                                    />
                                                </div>
                                                <div class="uploader white">
                                                    <input type="text" class="filename" name="protecter_back"
                                                           value="{$item.picUrl|default=''}" readonly/>
                                                    <input type="button" name="protecter_back" class="button" value="背面..."/>
                                                    <input type="file" id="up_img1" name="protecter_back"
                                                           value='{$item.picUrl|default=""}'  />
                                                </div>
                                            </div>

                                        </div>

                                    </div>

                                    <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">被保车辆行驶证:</label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <div style="float: left">
                                            <div id="imgdiv2">
                                                <img id="imgShow2" src="__PUBLIC__/{$item.single_pic|default=''}"
                                                     width="200" height="190" onerror="this.src='__STATIC__/images/default.png'"
                                                />
                                            </div>
                                            <div class="uploader white">
                                                <input type="text" class="filename" name="car_face"
                                                       value="{$item.picUrl|default=''}" readonly/>
                                                <input type="button" name="file" class="button" value="正面..."/>
                                                <input type="file" id="up_img2" name="car_face"
                                                       value='{$item.picUrl|default=""}'  />
                                            </div>
                                        </div>
                                        <div style="float: left">
                                            <div id="imgdiv3">
                                                <img id="imgShow3" src="__PUBLIC__/{$item.single_pic|default=''}"
                                                     width="200" height="190" onerror="this.src='__STATIC__/images/default.png'"
                                                />
                                            </div>
                                            <div class="uploader white">
                                                <input type="text" class="filename" name="car_back"
                                                       value="{$item.picUrl|default=''}" readonly/>
                                                <input type="button" name="file" class="button" value="背面..."/>
                                                <input type="file" id="up_img3" name="car_back"
                                                       value='{$item.picUrl|default=""}'  />
                                            </div>
                                        </div>

                                    </div>
                                     </div>
                                    {/in}

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" style="text-align: right">是否开发票：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="bill" id="status_3" class="cartradio"
                                                       value="1"
                                                       datatype="*"
                                                       nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                       {eq name='item.type|default="1"' value='1' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_3"></label>
                                                <span>是</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="bill" id="status_4" class="cartradio"
                                                       value="2"
                                                       datatype="*"
                                                       nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                       {eq name='item.bill|default=""' value='2' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_4"></label>
                                                <span>否</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>
                                    <div id="bill">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" style="text-align: right">发票类型：</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <label class="radio_box">
                                                    <input type="radio" name="bill_type" id="status_5" class="cartradio"
                                                           value="1"
                                                           datatype="*"
                                                           nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                           {eq name='item.type|default="1"' value='1' }
                                                           checked
                                                           {/eq}
                                                    >&nbsp;&nbsp;
                                                    <label for="status_5"></label>
                                                    <span>电子发票</span>
                                                    &nbsp;&nbsp;
                                                </label>
                                                <label class="radio_box">
                                                    <input type="radio" name="bill_type" id="status_7" class="cartradio"
                                                           value="2"
                                                           datatype="*"
                                                           nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                           {eq name='item.bill|default=""' value='2' }
                                                           checked
                                                           {/eq}
                                                    >&nbsp;&nbsp;
                                                    <label for="status_7"></label>
                                                    <span>普通发票</span>
                                                    &nbsp;&nbsp;
                                                </label>
                                                <label class="radio_box">
                                                    <input type="radio" name="bill_type" id="status_8" class="cartradio"
                                                           value="3"
                                                           datatype="*"
                                                           nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                           {eq name='item.bill|default=""' value='3' }
                                                           checked
                                                           {/eq}
                                                    >&nbsp;&nbsp;
                                                    <label for="status_8"></label>
                                                    <span>增值税发票</span>
                                                    &nbsp;&nbsp;
                                                </label>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" style="text-align: right">发票抬头：</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <label class="radio_box">
                                                    <input type="radio" name="bill_header" id="status_9" class="cartradio"
                                                           value="1"
                                                           datatype="*"
                                                           nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                           {eq name='item.type|default="1"' value='1' }
                                                           checked
                                                           {/eq}
                                                    >&nbsp;&nbsp;
                                                    <label for="status_9"></label>
                                                    <span>个人</span>
                                                    &nbsp;&nbsp;
                                                </label>
                                                <label class="radio_box">
                                                    <input type="radio" name="bill_header" id="status_10" class="cartradio"
                                                           value="2"
                                                           datatype="*"
                                                           nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                           {eq name='item.bill|default=""' value='2' }
                                                           checked
                                                           {/eq}
                                                    >&nbsp;&nbsp;
                                                    <label for="status_10"></label>
                                                    <span>单位</span>
                                                    &nbsp;&nbsp;
                                                </label>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">发票内容：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写发票内容"
                                                       class="form-control col-md-7 col-xs-12" name="bill_content"
                                                       value="{$item.bill_content|default=''}"
                                                >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">联系电话：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写联系电话"
                                                       class="form-control col-md-7 col-xs-12" name="bill_phone"
                                                       value="{$item.bill_phone|default=''}"
                                                >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">邮箱：</label>
                                            <div class="col-md-3 col-sm-6 col-xs-12" >
                                                <input type="text" placeholder="请填写邮箱"
                                                       class="form-control col-md-7 col-xs-12" name="bill_email"
                                                       value="{$item.bill_email|default=''}"
                                                >
                                            </div>
                                        </div>
                                    </div>

                                    {if condition="session('auding_status') eq 3" }
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">服务人员提成：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>服务人员</th>
                                                <th>提成金额</th>
                                                <th>服务内容</th>
                                                <th>操作</th>
                                                </thead>

                                                <tbody id="fieldtr">
                                                {volist name="shop_assignor_records" id="list"}
                                                <tr>
                                                    <!--<td>-->
                                                    <!--<select name="assignor_id[]" class="form-control" tabindex="-1">-->
                                                    <!--{volist name="$shop_assignor" id="li"}-->
                                                    <!--<option value="{$li.id}" {eq name="$li.id" value="$list.assignor_id"}selected{/eq}>{$li.name}</option>-->
                                                    <!--{/volist}-->
                                                    <!--</select>-->
                                                    <!--</td>-->
                                                    <td><input type="text" name="assignor_id[]" style="width:100px;" value="{$list.assignor_id}" /></td>
                                                    <td><input type="text" name="assignor_price[]" style="width:100px;" value="{$list.assignor_price}"  /></td>
                                                    <td><input type="text" name="assignor_content[]" style="width:100px;" value="{$list.assignor_content}"  /></td>
                                                    <td><a href="javascript:;" onClick="delThis($(this),{$list.id})" ></a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="5"><a href="javascript:;" class="addNewTr" title="新增一条" >1新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    {/if}
                                    <!--想用状态3屏蔽了2019.04.04-->
                                    {eq name=":input('order_is_free')" value="3"}
                                    <div class="form-group" id="service_people">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">服务人员提成：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>服务人员</th>
                                                <th>服务分类</th>
                                                <th>服务内容</th>
                                                <th>服务金额</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtr">
                                                {volist name="shop_assignor_records" id="list"}
                                                <tr>
                                                    <td>
                                                        <select name="assignor_id[]" class="form-control" tabindex="-1">
                                                            {volist name="$shop_assignor" id="li"}
                                                            <option value="{$li.id}" {eq name="$li.id" value="$list.assignor_id"}selected{/eq}>{$li.name}</option>
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <!--<td><input type="text" name="assignor_id[]" style="width:100px;" value="{$list.assignor_id}" /></td>-->
                                                    <td><input type="text" name="assignor_price[]" style="width:100px;" value="{$list.assignor_price}"  /></td>
                                                    <td><input type="text" name="assignor_content[]" style="width:100px;" value="{$list.assignor_content}"  /></td>
                                                    <td><input type="text" name="assignor_content[]" style="width:100px;" value="{$list.assignor_content}"  /></td>
                                                    <td><a href="javascript:;" onClick="delThis($(this),{$list.id})" >删除</a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="6"><a href="javascript:;" class="addNewTr" title="新增一条" >2新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    {/eq}

                                    <div class="form-group" id="service_people">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">商品添加：</label>
                                        <div class="col-md-8 col-sm-6 col-xs-12">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>商品分类</th>
                                                <th>商品规格</th>
                                                <th>商品数量</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtrgoods">

                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="5"><a href="javascript:;" class="addNewTrgoods" title="新增一条" >3新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>


                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">备注信息：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                                <textarea type="text" placeholder="备注" style="width: 500px;height: 100px;"
                                                          class="form-control col-md-7 col-xs-12" name="explain">{$item.explain|default=''}</textarea>

                                        </div>
                                    </div>

                            </div>


                                <div class="form-group">
                                    <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                        <a onClick="ajax_post()"  class="btn btn-primary">提交订单</a>
                                        <a type="reset" class="btn btn-success" onClick="history.go(-1)">返回</a>
                                    </div>
                                </div>
                                <input type="hidden" name="username" value="{:input('username')}">
                                <input type="hidden" name="single_id" value="{:input('single_id')}">
                                <input type="hidden" name="shop_id" value="{:input('shop_id')}">
                                <input type="hidden" name="order_is_free" value="{:input('order_is_free')}">
                                </form>

                                <script>
                                    function ajax_post() {
                                        {in name="$single_parent_id" value="1,2"}
                                        var crowd_file1 = $('#up_img')[0].files[0];
                                        var crowd_file2 = $('#up_img1')[0].files[0];
                                        var crowd_file3 = $('#up_img2')[0].files[0];
                                        var crowd_file4 = $('#up_img3')[0].files[0];
                                        console.log(crowd_file1);
                                        console.log(crowd_file2);
                                        console.log(crowd_file3);
                                        console.log(crowd_file4);
                                        {/in}
                                        var post_data = $("form").serializeArray();
                                        console.log(post_data);
                                        var formData = new FormData();
                                            {in name="$single_parent_id" value="1,2"}
                                        formData.append("image1", crowd_file1);
                                        formData.append("image2", crowd_file2);
                                        formData.append("image3", crowd_file3);
                                        formData.append("image4", crowd_file4);
                                            {/in}
                                        console.log(formData);
                                        for (i = 0; i < post_data.length; i++) {
                                            if (!post_data[i]['value']) {
                                                // alert('所有表单字段必须全部填写');
                                                //return;
                                            }
                                            formData.append(post_data[i]['name'], post_data[i]['value']);
                                        }
                                        console.log(formData);
//                                        return ;
                                        $.ajax({
                                            type: 'POST',
                                            url: "{:url('create')}",
                                            data: formData,
                                            processData: false, // 使数据不做处理
                                            contentType: false, // 不要设置Content-Type请求头
                                            success: function (msg) {
//                                                alert(console.log(msg));
                                                if (msg.code == 200) {
                                                    window.location.href = "{:url('service_order/index')}";
                                                } else {
                                                    layer.msg(msg.message);
                                                }
                                            }
                                        });
                                    }
                                </script>

                            </div>
                        </div>
                    </div>


                </div>
                <!-- /page content -->

            </div>

        </div>
    </div>


    {include file="public_foot" /}


    <link rel="stylesheet" href="/zoomify.min.css">

    <script src="/zoomify.min.js"></script>
    <script type="text/javascript">
        //$('.example img').zoomify();
    </script>
    <!-- validform -->
    <script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
    <script src="__STATIC__/js/layer.js"></script>
    <!--select-->
    <script src="__STATIC__/js/select/select2.full.min.js"></script>

    <script>
        //validform
        $(function () {

            $.Tipmsg.r = null;

            var showmsg = function (msg) {
                //假定你的信息提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
                alert(msg);
            }
            $("#registerForm").Validform({
                tiptype: function (msg) {
                    layer.msg(msg);
                },
                tipSweep: true
            });



        })
        $('.tt').click(function(){
            //$(this).toggleClass('max');
            // $(this).toggleClass('min');
        });
        function cancel(member_id,order_id){

            // $(function(){ 不取消 ajax失效 这么回事呢？
//            var member_id = member_id;
            //var order_id = order_id;
            //$('#send').click(function(){

            $.ajax({
                type: "POST",
                url: "{:url('index/order/cancel')}",
                data: {member_id:member_id, order_id:order_id},
                dataType: "json",
                success: function(data){

                    console.log(1);
                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg('订单取消成功');
                        history.go(0);
                        window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg('取消失败');
                    }
                    //var html = '';

//                        $.each(data, function(commentIndex, comment){
//
//                            html += '<div class="comment"><h6>' + comment['username']
//
//                                + ':</h6><p class="para"' + comment['content']
//
//                                + '</p></div>';
//
//                        });
//
//                        $('#resText').html(html);

                }

            });

            /// });

            //});
        }


        function take(order_id){

            // $(function(){ 不取消 ajax失效 这么回事呢？
//            var member_id = member_id;
            //var order_id = order_id;
            //$('#send').click(function(){

            $.ajax({
                type: "POST",
                url: "{:url('console/service_order/take_tyre')}",
                data: {order_id:order_id},
                dataType: "json",
                success: function(data){
                    console.log(data);
                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg('轮胎已设置取走');
                        history.go(0);
                        window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg('设置失败');
                    }
                }
            });

        }
    </script>
    <script>
        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true,

        });
        // validform
        $(function () {

            $.Tipmsg.r = null;
            $.Datatype.int = /^[1-9]\d*$/;
            var showmsg = function (msg) {
                //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
                alert(msg);
            }
            $("#registerForm").Validform({
                tiptype: function (msg) {
                    layer.msg(msg);
                },
                tipSweep: true,

            });

            // interval_timer
            $('#interval_timer').daterangepicker(null,
                function(start, end, label) {
                    console.log(start.toISOString(), end.toISOString(), label);
                });

            // select2
            $(".select2_multiple").select2({
                maximumSelectionLength: 0,
                placeholder: "请选择关联栏目",
                allowClear: true
            });
        })
    </script>

    <!-- upload_arr -->
    <script src="__STATIC__/js/upload.photos.js"></script>
    <script type="text/javascript" src="__STATIC__/plupload/plupload.full.min.js"></script>
    <!-- Times -->
    <script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
    <!-- validform -->
    <script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
    <script src="__STATIC__/js/layer.js"></script>
    <!-- select -->
    <script src="__STATIC__/js/select/select2.full.min.js"></script>
    <!-- upload -->
    <script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>

    <!-- ueditor -->
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript">



    </script>
    <script>
        $(".del").live("click", function () {

            $(this).parent().parent(".item").remove();
        })
        // 组图排序 删除图片
        $(".toleft").live("click", function () {
            var item = $(this).parent().parent(".item");
            var item_left = item.prev(".item");
            if ($("#photos_area").children(".item").length >= 2) {
                if (item_left.length == 0) {
                    item.insertAfter($("#photos_area").children(".item:last"));
                } else {
                    item.insertBefore(item_left);
                }
            }

        })

        $(".toright").live("click", function () {
            var item = $(this).parent().parent(".item");
            var item_right = item.next(".item");
            if ($("#photos_area").children(".item").length >= 2) {
                if (item_right.length == 0) {
                    item.insertBefore($("#photos_area").children(".item:first"));
                } else {
                    item.insertAfter(item_right);
                }
            }
        })


        // validform
        $(function () {
            $(".select2_multiple").select2({
                maximumSelectionLength: 0,
                placeholder: "请选择关联栏目",
                allowClear: true
            });
            $.Tipmsg.r = null;

            var showmsg = function (msg) {
                //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
                alert(msg);
            }
            $("#registerForm").Validform({
                tiptype: function (msg) {
                    layer.msg(msg);
                },
                tipSweep: true
            });


            // upload
            new uploadPreview({UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow"});

            // select2
            $(".select2_single").select2({
                placeholder: "请选择分类",
                allowClear: true
            });




            $(":radio").click(function () {

                if (this.checked) {
                    if ($(this).attr("id") == "freight_type_1") {
                        $("#immobilization").show();
                        $("#template").hide();
                    }else{
                        $("#immobilization").hide();
                        $("#template").hide();
                    }
                }
            });
        });

        // 组图上传
        var uploader = new plupload.Uploader({
            runtimes: 'html5,flash,silverlight,html4',
            browse_button: 'logo_upload_btn',
            url: "/index.php/client/shop_goods/uploadarr.html",
            flash_swf_url: '__STATIC__/plupload/Moxie.swf',
            silverlight_xap_url: '__STATIC__/plupload/Moxie.xap',

            filters: {
                max_file_size: '5000kb',
                mime_types: [
                    {title: "files", extensions: "jpg,png,gif,jpeg"}
                ]
            },
            multi_selection: true,
            init: {
                FilesAdded: function (up, files) {
                    $("#btn_submit").attr("disabled", "disabled").addClass("disabled").val("正在上传...");
                    var item = '';
                    plupload.each(files, function (file) { //遍历文件
                        item += "<div class='item' id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></div>";
                    });
//                var item_right = item.next(".item");
////                alert(item_right.length);
//                if(item_right.length >= 2){
//                    alert('最多只能上传2图片');
//                    return false;
//                }
                    $("#photos_area").append(item);
                    uploader.start();
                },
                UploadProgress: function (up, file) { //上传中，显示进度条
                    var percent = file.percent;
                    $("#" + file.id).find('.bar').css({"width": percent + "%"});
                    $("#" + file.id).find(".percent").text(percent + "%");
                },
                FileUploaded: function (up, file, info) {

                    var data = eval("(" + info.response + ")");

                    $("#" + file.id).html("<input type='hidden' name='picArr[]' value='" + data.src + "'><img src='__PUBLIC__/" + data.src + "' alt='" + data.name + "' width='100px' height='100px'><div class='operate'><i class='toleft'>左移</i><i class='toright'>右移</i><i class='del'>删除</i></div>")
                    $("#btn_submit").removeAttr("disabled").removeClass("disabled").val("提 交");
                    if (data.error != 0) {
                        layer.msg(data.error);
                    }
                },
                Error: function (up, err) {
                    layer.msg(err.message);
                    $("#btn_submit").removeAttr("disabled").removeClass("disabled").val("提 交");
                }
            }
        });
        uploader.init();


        function delThisTr(trobj)
        {
            trobj.parent().parent().remove();
        }

        function delThis(trobj,id)
        {
            if(confirm('确认删除？')){
                $.ajax({
                    url : '{:url("shop_assignor_records")}',
                    data:{'id':id},
                    dataType:'html',
                    success:function(data){
                        data = JSON.parse(data);
                        console.log(data)
                        if(data.code == 200){
                            layer.msg('删除成功');
                            trobj.parent().parent().remove();
                        }else{
                            layer.msg(data.message);
                        }
                    }
                });
            }
        }
        var assgioner = {$shop_assignor};
        console.log(assgioner);
        var s = [];
        var ss = [];
        $.each(assgioner, function(k,v){
            ss += '<option value="'+v.id+'">'+v.name+'</option>';
        });

        s = '<tr><td><select name="status" class="form-control" tabindex="-1">' + ss
        s += '</select></td>';

        var gift_c = '';
        console.log({$service_people_price});
        $.each({$service_people_price}, function(k,v){ //服务人员提成
            gift_c += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });

        var gift_d = '';
        $.each({$service_people_price2}, function(k,v){ //服务人员提成
            gift_d += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });
        console.log('1111111111111'+gift_c);
        console.log('22222222222222222'+gift_d);


        $(".addNewTr").click(function(){
            var str = '<tr><td><select name="assignor_id[]" class="select2_single form-control" tabindex="-1">' + ss +
                '</select></td>' +
                '<td><select name="single_id_post[]" onchange="single2(this.value,this)" class="select2_single form-control" >' + gift_c +
                '<td><select name="assignor_content[]" onchange="single2(this.value,this)" class="select2_single form-control" >' + gift_d +
                '<td><input type="text" style="padding-top: 8px;" readonly name="assignor_price[]" value="{$service_people_price2.0.person_price|default='0'}" style="width:100px;"   /></td>'+
            '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td></tr>';
            str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
            str +="<script>\n" +
                "                                        $(\".select2_single\").select2({\n" +
                "                                            placeholder: \"请选择分类\",\n" +
                "                                            allowClear: true\n" +
                "                                        });\n" +
                "                                    <\/script>";
            $("#fieldtr").append(str);
        });




c

    </script>
    <!-- daterangepicker -->
    <script src="__STATIC__/js/datepicker/daterangepicker.js"></script>
    <script type="text/javascript">
        $('#interval_timer').daterangepicker(null,
            function(start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
            });
        var str = '<a href="http://www.baidu.com">链接111111111</a> ';
        var reg1 = /href=\"(.+)\"/g;
        var reg2 = /\">(.+)<\/a>/g;
        var retVal1 = reg1.exec(str);
        var retVal2 = reg2.exec(str);
        //alert(retVal1[1]);
        //alert(retVal2[1]);
    </script>
    <script src="__STATIC__/js/sku.js"></script>
</body>

</html>
<!--与代码无关可以删除-->
<script src="/pic/js/jquery.min.js"></script>
<script src="/pic/js/amazeui.js"></script>
<!--<script src="/jquery-1.10.2.js" type="text/JavaScript" language="javascript"></script>-->
<!--<script src="/jquery-ui-1.10.4.custom.js"></script>-->
<script src="/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
<script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
<script>

    $('#status_2').click(function () {

        $('#shipping').hide();

    });
    $('#status_1').click(function () {

        $('#shipping').show();

    });
    $('#status_4').click(function () {

        $('#bill').hide();

    });
    $('#status_3').click(function () {

        $('#bill').show();

    });
    $("#btnPrint").click(function(){
        $("#printArea").printArea();
    });
    $("#btnPrintFull").click(function(){
        $("body").printArea();
    });
    new uploadPreview({UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow"});
    new uploadPreview({UpBtn: "up_img1", DivShow: "imgdiv1", ImgShow: "imgShow1"});
    new uploadPreview({UpBtn: "up_img2", DivShow: "imgdiv2", ImgShow: "imgShow2"});
    new uploadPreview({UpBtn: "up_img3", DivShow: "imgdiv3", ImgShow: "imgShow3"});
</script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<script>
    //分类
    var category = {$category};
    var cat_list = '<option value="0">'+'&nbsp&nbsp'.repeat(1)+'|--全部分类</option>';
    var repeat = '-';
    $.each(category, function(k,v){
        cat_list += '<option value="'+v.id+'">'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.title+'</option>';
    });
    //规格商品 门店或全部
    var spec_attr_list = {$spec_attr_list};
    var spec_list = [];
    console.log(spec_attr_list);
    $.each(spec_attr_list, function(k,v){
        spec_list += '<option value="'+v.id+'">'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.shop_title+'-'+v.title+'-'+v.attribute+'-'+v.inventory+'</option>';
    });
    console.log(spec_list);
    $(".addNewTrgoods").click(function(){
        str =
            '<tr>' +
            '<td><select name="cat_id[]" onchange="goods_list(this.value,this)" class="select2_single form-control" tabindex="-1">' + cat_list +
            '</select></td>' +
            '<td><select name="spec_id[]" id="spec" class="select2_single form-control" tabindex="-1">' + spec_list +
            '</select></td>' +
            '<td><input type="text" name="number[]" oninput="inventory(this,this.value)"  /></td>'+
            '<td><input type="text" value="{:date('Y-m-d H:i:s',time())}" /></td>' +
        '<td><a href="javascript:;" onclick="delThisTrgoods($(this))">删除</a></td>' +
        '</tr>';
        str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
        str +="<script>\n" +
            "                                        $(\".select2_single\").select2({\n" +
            "                                            placeholder: \"请选择分类\",\n" +
            "                                            allowClear: true\n" +
            "                                        });\n" +
            "                                    <\/script>";
        $("#fieldtrgoods").append(str);
    });
    function delThisTrgoods(trobj)
    {

        trobj.parent().parent().remove();
    }
    function delThigoods(trobj,id) {
        if(confirm('确认删除？')){
            $.ajax({
                url : '{:url("service_order_goods")}',
                data:{'id':id},
                dataType:'html',
                success:function(data){
                    data = JSON.parse(data);
                    console.log(data)
                    if(data.code == 200){
                        layer.msg('删除成功');
                        trobj.parent().parent().remove();
                    }else{
                        layer.msg(data.message);
                    }
                }
            });
        }
    }
    function inventory(t,number) {
        console.log($(this));
        var spec_id = $(t).parent().prev().find('select').val();

        $.ajax({
            url : '{:url("service_order/inventory")}',
            data:{'number':number,'spec_id':spec_id},
            dataType:'json',
            success:function(data){
                if(data.code != 200){
                    layer.msg(data.message);
                    return false;
                }
            }
        });
//        $('name=["spec_id"]').val();
//        if(number > inventory){
//            layer.msg('商品数量大于库存数量');
//        }
    }
    function goods_list(id,t){
        var shop_id = {:input('shop_id')};
        $.ajax({
            url : '{:url("goods_list_create")}',
            data:{'cat_id':id,'shop_id':shop_id},
            dataType:'json',
            success:function(data){
                var str = [];
                console.log(data);
                str = '<select name="spec_id[]" class="select2_single form-control" tabindex="-1">';
                $.each(data, function(k,v){
                    str += '<option value="'+v.id+'">'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.shop_title+'-'+v.title+'-'+v.attribute+'-'+v.inventory+'</option>';
                });
                str += '</select>';
                str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
                str +="<script>\n" +
                    "                                        $(\".select2_single\").select2({\n" +
                    "                                            placeholder: \"请选择分类\",\n" +
                    "                                            allowClear: true\n" +
                    "                                        });\n" +
                    "                                    <\/script>";
                $(t).parent().next().html(str);
//                console.log(str);
            }
        });
    }
</script>